<!DOCTYPE html>
<html>

<head>
    <script>
        // 用ajax获取数据
        function flushContent() {
            neirongboxConfig.loadUpFn();
        }

        // 初始化列表
        info_type = "{$infoDefaultType}";
        goods_type = "{$goodsDefaultType}";

    </script>
    <meta charset="utf-8" />
    <meta name="viewport" content="width=device-width,initial-scale=1,minimum-scale=1,maximum-scale=1,user-scalable=no" />
    <title></title>
    <link rel="stylesheet" type="text/css" href="{$_G['addon_url']}/Public/css/weuix.min.css" />
    <link rel="stylesheet" type="text/css" href="{$_G['addon_url']}/Public/css/weui.css" />
    <link rel="stylesheet" type="text/css" href="{$_G['addon_url']}/Public/css/weui2.css" />
    <link rel="stylesheet" type="text/css" href="{$_G['addon_url']}/Public/css/weui3.css" />
    <link rel="stylesheet" type="text/css" href="{$_G['addon_url']}/Public/css/jquery-weui.min.css" />
    <link rel="stylesheet" type="text/css" href="{$_G['addon_url']}/Public/css/icon.css" />
    <link rel="stylesheet" type="text/css" href="{$_G['addon_url']}/Public/css/style.css" />
    {:hook('jssdk',false)}
    <script>
        wx.ready(function () {
            wx.onMenuShareTimeline({
                title: '{$config['index_title']}', // 分享标题
                link: '{:get_current_url()}', // 分享链接
                imgUrl: '{$config['index_imgs']}'
            });

            wx.onMenuShareAppMessage({
                title: '{$config['index_title']}', // 分享标题
                desc: '{$config['index_desc']}', // 分享链接
                link: '{:get_current_url()}', // 分享链接
                imgUrl: '{$config['index_imgs']}', // 分享图标
                type: '', // 分享类型,music、video或link，不填默认为link
                dataUrl: '', // 如果type是music或video，则要提供数据链接，默认为空
                success: function () {
                    // 用户确认分享后执行的回调函数
                },
                cancel: function () {
                    // 用户取消分享后执行的回调函数
                }
            });

        })

        function needAuth(x){
            $.ajax({
                url:"{:create_mobile_url('isAuth')}",
                type:"get",
                dataType:"json",
                data:{},
                success:function(data){
                    console.log(data);
                    if (data.status == 1) {
                        window.location.href = "tel:"+$(x).attr('tel');
                    } else {
                        $.toast("请先关注公众号", "forbidden");
                        setTimeout(function(){
                            location.href = "{:create_mobile_url('code')}";
                        },1500);
                        return false;
                    }
                },
                error:function(){
                    $.toast("错误", "forbidden");
                }
            });
            return true;
        }
    </script>
    <style id="LazyloadImg-style" type="text/css">
        .LazyloadImg-qriginal {
            -webkit-transition: none!important;
            -moz-transition: none!important;
            -o-transition: none!important;
            transition: none!important;
            background-size: cover!important;
            background-position: center center!important;
            background-repeat: no-repeat!important;
            z-index: 50;
        }

        @media screen and (max-width: 400px) {
            .roo img {
                width:87px;
                height:87px;
            }
        }


    </style>

</head>

<body ontouchstart>
<!--
    顶部导航
-->
<div id="tou">


    <!--<div class="weui-header bg-orange">-->
        <!--&lt;!&ndash;<div class="weui-header-left">&ndash;&gt;-->
        <!--&lt;!&ndash;<a class="icon icon-109 f-white"></a>&ndash;&gt;-->
        <!--&lt;!&ndash;</div>&ndash;&gt;-->
        <!--<h1 class="weui-header-title"></h1>-->
        <!---->
    <!--</div>-->
    <div class="page-bd weui_cell_switch" id="gudin">
        <ul>
            <li class="">
                <div class="weui-flex js-category">
                    <p class="weui-flex-item" id="">信息分类</p>
                    <i class="icon icon-74"></i>
                </div>
                <div class="page-category js-categoryInner">
                    <div class="weui_cells weui_cells_access" id="atvanniu" style="margin-top: 0px;padding-bottom: 10px;padding-left: 10px;">
                        <!--<a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default bg-orange-b">不限</a>-->
                        <a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default">求购信息</a>
                        <a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default">货品信息</a>
                    </div>
                </div>
            </li>
            <li class="">
                <div class="weui-flex">
                    <p class="weui-flex-item" id="">货品分类<input name="fenlei2"  class="weui_input" type="text" id="ss" value="{$goodsDefaultType}" readonly=""></p>
                    <i class="icon icon-74"></i>
                </div>
                <div class="page-category js-categoryInner">
                    <div class="weui_cells weui_cells_access" id="atvanniu" style="margin-top: 0px;padding-bottom: 12px;padding-left: 10px;">
                        <a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default bg-orange-b">不限</a>
                        <a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default">鱼</a>
                        <a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default">虾</a>
                        <a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default">蟹</a>
                        <a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default">贝</a>
                        <a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default">软体</a>
                        <a href="javascript:;" class="weui_btn weui_btn_mini weui_btn_default">半成品</a>
                    </div>
                </div>
            </li>
            <li style="width:20%;line-height:45px;
    text-align:center;">
                <div class="weui-header-right">
                    <a class="icon icon-36 " href="{:create_mobile_url("fabu")}"></a>
                </div>
            </li>
        </ul>
    </div>
</div>
<div class="xila">
    <div class="neirongbox">
        <div class="weui_cells moments">

            <!-- 普通的post -->
            <!--<div class="weui_cell moments__post weui-border-b">

                <div class="weui_cell_hd">
                    <img class="circle" src="{$_G['addon_url']}/Public/img/touxiang.jpg">
                </div>
                <div class="weui_cell_bd">
                    &lt;!&ndash; 人名链接 &ndash;&gt;
                    <a class="title" href="javascript:;">
                        <span class="f-blue">我就是老大</span>
                    </a>
                    &lt;!&ndash; post内容 &ndash;&gt;
                    <p id="paragraph" class="paragraph">
                        weui目前是比较好用的ui,在微信和手机中表现非常好。
                    </p>
                    &lt;!&ndash; 相册111111 &ndash;&gt;
                    <div class="thumbnails">
                        <div class="roo weui-updown">
                            <img class="img-max lazyload" src="{$_G['addon_url']}/Public/img/504.jpg" style="-webkit-animation: fadeIn 01s ease 0.2s 1 both;animation: fadeIn 1s ease 0.2s 1 both;">
                        </div>
                        <div class="roo weui-updown">
                            <img class="img-max lazyload" src="{$_G['addon_url']}/Public/img/5608.jpg" style="-webkit-animation: fadeIn 01s ease 0.2s 1 both;animation: fadeIn 1s ease 0.2s 1 both;">
                        </div>
                        <div class="roo weui-updown">
                            <img class="img-max lazyload" src="{$_G['addon_url']}/Public/img/5515.jpg" style="-webkit-animation: fadeIn 01s ease 0.2s 1 both;animation: fadeIn 1s ease 0.2s 1 both;">
                        </div>
                    </div>
                    &lt;!&ndash; 资料条 &ndash;&gt;
                    <div class="toolbar">
                        <p class="timestamp"><span>09-07</span>&nbsp;<span>00:52</span></p>
                        <div>
                            <div id="actionMenu" class="actionMenu slideIn">
                                <p class="actionBtn" id="btnLike"><i class="icon icon-96"></i></p>
                                <p class="actionBtn" id="btnComment"><i class="icon icon-3"></i></p>
                            </div>
                        </div>
                        <span id="actionToggle" class="actionToggle">..</span>
                    </div>
                    &lt;!&ndash; 赞／评论区 &ndash;&gt;
                    <div class="liketext">
                        <p><span class="nickname f-blue">Yoby</span>:<span class="nickname">巴拉巴拉巴拉</span></p><br/>
                        <p><span class="nickname f-blue">热狗</span>回复<span class="nickname  f-blue">Yoby</span>:<span class="nickname">巴拉巴拉巴拉</span></p>
                    </div>
                    <div class="weui_cells weui_cells_form" style="display: none;">
                        <div class="weui_cell weui_vcode">
                            <div class="weui_cell_bd weui_cell_primary">
                                <input class="weui_input" type="text" placeholder="评论">
                            </div>
                            <div class="weui_cell_ft">
                                <a href="javascript:;" class="weui-vcode-btn bg-orange">发送</a>
                            </div>
                        </div>
                    </div>
                </div>
                &lt;!&ndash; 结束 post &ndash;&gt;
            </div>-->
            <!-- 结束 post -->
        </div>
        <!-- 结束 moments -->
        <!--<div class="dropload-down">
            <div class="dropload-noData">没有更多数据了</div>
        </div>-->
    </div>
</div>
<!--结束xiala-->
<div class="weui_tabbar" style="height:50px;">
    <a href="javascript:;" class="weui_tabbar_item">
        <div class="weui_tabbar_icon">
            <img src="{$_G['addon_url']}/Public/img/icon_nav_search_bar.png" alt="">
        </div>
        <p class="weui_tabbar_label arta" style="font-size:14px;!important"> 首页</p>
    </a>
    <a href="{:create_mobile_url("userCenter")}" class="weui_tabbar_item">
    <div class="weui_tabbar_icon">
        <img src="{$_G['addon_url']}/Public/img/me.png" alt="">
    </div>
    <p class="weui_tabbar_label" style="font-size:14px;!important">我的</p>
    </a>
</div>
</body>
<script src="{$_G['addon_url']}/Public/js/jquery-3.2.1.min.js" type="text/javascript" charset="utf-8"></script>
<script src="{$_G['addon_url']}/Public/js/jquery-weui.min.js" type="text/javascript" charset="utf-8"></script>
<script type="text/javascript">
    $(window).scroll(function() {
        var hei = $(document).scrollTop();
        if(hei >= 45) {
//            $("#gudin").addClass('toptar');
            $('.js-categoryInner').addClass('ksjf');
        }
        if(hei <= 45) {
//            $("#gudin").removeClass('toptar');
            $('.js-categoryInner').removeClass('ksjf');
        }
    });
    $('.weui_tabbar').on('click', 'a', function() {
        $(this).children('p').addClass('arta');

        $(this).siblings().children('p').removeClass('arta');

    });
    $('.weui-menu').on('click', '.weui-menu-inner', function() {
        $(this).children('i').removeClass('icon-6');
        $(this).children('i').addClass('icon-8');
    });

    //      评论输入框的行为
    $(function() {
        $('.moments').on('click', '.actionToggle', function(e) {
            $('input.weui_input').attr('placeholder', '评论');
            $(this).parent().siblings('.weui_cells_form').toggle(1);
            $(this).parents('.liketext').siblings('.weui_cells_form').find('input.weui_input').focus();
            e.stopPropagation();
        });
        $('.moments').on('click', '.weui-comment-item', function(e) {
            var id = $(this).attr('id');
            var usename = $(this).find('.nickname').html();
            var pinglun = $(this).parents('.liketext').siblings('.weui_cells_form');
            pinglun.find('input.weui_input').attr('placeholder', '回复' + usename);
            pinglun.find('input.weui_input').attr('pid',id);
            pinglun.show(1);
            pinglun.find('input.weui_input').focus();
            e.stopPropagation();
        });
        $('.moments').on('click', '.weui-comment-msg .replay', function(e) {
            var usename = $(this).find('.nickname').html();
            var id = $(this).attr('id');
            var xiaoxi = $(this).parents('.liketext').siblings('.weui_cells_form');
            xiaoxi.find('input.weui_input').attr('placeholder', '回复' + usename);
            xiaoxi.find('input.weui_input').attr('pid',id);
            xiaoxi.show(1);
            xiaoxi.find('input.weui_input').focus();
            e.stopPropagation();
        });

    });


    $('.weui_cells_access').on('click', 'a', function() {
        $(this).addClass('bg-orange-b').siblings('a').removeClass('bg-orange-b');
        // alert($(this).text());
        // 获取信息分类
        info_type = $(this).text();
        flushContent();
        var icon = $(".js-show").find(".icon-35");
        icon.removeClass("icon-35");
        icon.addClass("icon-74");
        $(".js-show").removeClass("js-show");
        $(".weui_mask_visible").remove();

    });
</script>
<script src="{$_G['addon_url']}/Public/js/lazyimg.js" type="text/javascript" charset="utf-8"></script>
<script src="{$_G['addon_url']}/Public/js/updown.js" type="text/javascript" charset="utf-8"></script>
<!--<script src="{$_G['addon_url']}/Public/js/xiala.js" type="text/javascript" charset="utf-8"></script>-->
<script>
    //<<<<<<< HEAD
    //页数
    var page = 1;
    // 每页展示10个
    var size = 10;

    neirongboxConfig = {
        scrollArea: window,
        autoLoad: true, //自动加载
        domDown: { //上拉
            domClass: 'dropload-down',
            domRefresh: '<div class="dropload-refresh f15 "><i class="icon icon-20"></i>上拉加载更多</div>',
            domLoad: '<div class="dropload-load f15"><span class="weui-loading"></span>正在加载中...</div>',
            domNoData: '<div class="dropload-noData">没有更多数据了</div>'
        },
        domUp: { //下拉
            domClass: 'dropload-up',
            domRefresh: '<div class="dropload-refresh"><i class="icon icon-114"></i>上拉加载更多</div>',
            domUpdate: '<div class="dropload-load f15"><i class="icon icon-20"></i>释放更新...</div>',
            domLoad: '<div class="dropload-load f15"><span class="weui-loading"></span>正在加载中...</div>'
        },
        loadUpFn: function(me) { //下拉刷新
            $.ajax({
                type: 'GET',
                url: '{:create_mobile_url("ajaxGetGoods")}&page=1&size=' + size + '&infoType=' + info_type + '&goodsType=' + goods_type,

                dataType: 'json',
                success: function(dataArray) {
                    // ++page;
                    var reslt = '';
                    for(var i = 0; i < dataArray.length; i++) {
                        var data = dataArray[i];
                        reslt += '<div class="goods weui_cell moments__post weui-border-b">' +
//=======
//        //页数
//        var page = 0;
//        // 每页展示10个
//        var size = 10;
//
//        neirongboxConfig = {
//            scrollArea: window,
//            autoLoad: true, //自动加载
//            domDown: { //上拉
//                domClass: 'dropload-down',
//                domRefresh: '<div class="dropload-refresh f15 "><i class="icon icon-20"></i>上拉加载更多</div>',
//                domLoad: '<div class="dropload-load f15"><span class="weui-loading"></span>正在加载中...</div>',
//                domNoData: '<div class="dropload-noData">没有更多数据了</div>'
//            },
//            domUp: { //下拉
//                domClass: 'dropload-up',
//                domRefresh: '<div class="dropload-refresh"><i class="icon icon-114"></i>上拉加载更多</div>',
//                domUpdate: '<div class="dropload-load f15"><i class="icon icon-20"></i>释放更新...</div>',
//                domLoad: '<div class="dropload-load f15"><span class="weui-loading"></span>正在加载中...</div>'
//            },
//            loadUpFn: function(me) { //下拉刷新
//                $.ajax({
//                    type: 'GET',
//                    url: '{:create_mobile_url("ajaxGetGoods")}&page=1&size=' + size + '&infoType=' + info_type + '&goodsType=' + goods_type,
//
//                    dataType: 'json',
//                    success: function(dataArray) {
//                        console.log(dataArray);
//                        // ++page;
//                        var reslt = '';
//                        for(var i = 0; i < dataArray.length; i++) {
//                            var data = dataArray[i];
//                            reslt += '<div class="goods weui_cell moments__post weui-border-b">' +
//>>>>>>> 4df56e99bd56110e62d252aab94c53f24cc96260
                                '<input type="hidden" value="'+ data.id +'" name="id" >' +
                                '<div class="weui_cell_hd">' +
                                '<a href="{:create_mobile_url('myDetail')}&id='+data.id+'"><img class="circle" src="'+data.head+'"></a>' +
                        '</div>' +
                        '<div class="weui_cell_bd">' +
                        '<a class="title" href="javascript:;">' +
                        '<span class="f-blue">'+data.username+'</span>' +
                        '</a>' +
                        '<a href="javascript:void(0)" tel="'+data.mobile+'" class="phone" onclick="needAuth(this)"> <span class="icon icon-104"></span> </a>'+
                        '<p id="paragraph" class="paragraph">' +
                        data.desc +
                        '</p>' +
                        '<div class="thumbnails">'
                        for(var j = 0 ; j < data.imgs.length ; ++j) {
                            reslt += '<div class="roo weui-updown">' +
                                    '<img class="img-max lazyload" src="'+data.imgs[j]+'" style="-webkit-animation: fadeIn 01s ease 0.2s 1 both;animation: fadeIn 1s ease 0.2s 1 both;">' +
                                    '</div>';
                        }

                        reslt +=
                                '</div>' +
                                '<div class="toolbar">' +
                                '<p class="timestamp"><span>'+data.date+'</span></p>' +
                                '<div>' +
                                '<div id="actionMenu" class="actionMenu slideIn">' +
                                '<p class="actionBtn" id="btnLike"><i class="icon icon-96"></i></p>' +
                                '<p class="actionBtn" id="btnComment"><i class="icon icon-3"></i></p>' +
                                '</div>' +
                                '</div>' +
                                '<span id="actionToggle" class="actionToggle">..</span>' +
                                '</div>' +
                                '<div class="liketext">';
                        for(var j = 0 ; j < data.comment.length; ++j) {
                            var obj = data.comment[j];
                            if(obj['id']){
                                reslt+='<ul class="weui-comment"><li class="weui-comment-item" id="'+obj.id+'">'+
                                        '<div class="userinfo"> <strong class="nickname">'+obj.nickname+'</strong>:</div>'+
                                        '<div class="weui-comment-msg"> <span class="stat"> '+obj.content+' </span>';
                                if(typeof obj.c !="undefined"){
                                    for(var x=0;x<obj.c.length;x++){
                                        reslt+='<div class="replay" style="margin-top: 6px" id="'+obj.c[x].id+'">'+
                                                '<span class="nickname" style="font-size: 15px">'+obj.c[x].nickname+'</span>&nbsp; 回复:'+obj.c[x].rele+':'+
                                                '<span class="weui-comment-msg">'+obj.c[x].content+'</span></div>';
                                    }
//                                                   result+= '<div class="replay" style="margin-top: 6px">'+
//                                                    '<span class="nickname" style="font-size: 15px">管理员&nbsp;:</span>'+
//                                                    '<span class="weui-comment-msg">哈哈哈</span></div><div class="replay"><span class="nickname" style="font-size: 15px">梁小五&nbsp;: </span>'+
//                                                    '<span class="weui-comment-msg">你怎么看？</span>';
//                                                     $result+='</div> ';
                                }
                                reslt+='</div></li> </ul>';
                            }
                        }



                        reslt += '</div>' +
                                '<div class="weui_cells weui_cells_form" style="display: none;">' +
                                '<div class="weui_cell weui_vcode" gid="'+data.id+'">' +
                                '<div class="weui_cell_bd weui_cell_primary">' +
                                '<input class="weui_input" type="text" placeholder="评论" pid="0">' +
                                '</div>' +
                                '<div class="weui_cell_ft">' +
                                '<a href="javascript:;" class="weui-vcode-btn bg-orange fasong">发送</a>' +
                                '</div>' +
                                '</div>' +
                                '</div>' +
                                '</div>' +
                                '</div>';
                    }
                    // 为了测试，延迟1秒加载
                    setTimeout(function() {
                        $('.moments').html(reslt);

                        // 每次数据加载完，必须重置
                        me.resetload();
                        // 重置索引值，重新拼接more.json数据
                        // page++;
                        page = 2;
                        // 解锁
                        me.unlock();
                        me.noData(false);
                        // me.hasData();
                    }, 1000);

                },
                error: function(xhr, type) {
                    // alert('Ajax error!');
                    // 即使加载出错，也得重置
                    // me.resetload();
                }
            });
        },
        loadDownFn: function(me) { //上啦加载更多

//            page++;
            window.history.pushState(null, document.title, window.location.href);
            var result = '';
            $.ajax({
                type: 'GET',
                url: '{:create_mobile_url("ajaxGetGoods")}&page='+page+'&size=' + size + '&infoType=' + info_type + '&goodsType=' + goods_type,
                dataType: 'json',
                success: function(dataArray) {
                    ++page;
                    var arrLen = dataArray.length;
                    console.log(dataArray);
                    if(arrLen > 0) {

                        for(var i = 0; i < arrLen; i++) {
                            var data = dataArray[i];
                            result += '<div class="article weui_cell moments__post weui-border-b">' +
                                    '<input type="hidden" value="'+ data.id +'" name="id" >' +
                                    '<div class="weui_cell_hd">' +
                                    '<a href="{:create_mobile_url('myDetail')}&id='+data.id+'"><img class="circle" src="'+data.head+'"></a>' +
                            '</div>' +
                            '<div class="weui_cell_bd">' +
                            '<a class="title" href="javascript:;">' +
                            '<span class="f-blue">'+data.username+'</span>' +
                            '</a>' +
                            '<a href="javascript:void(0)" tel="'+data.mobile+'" class="phone" onclick="needAuth(this)"> <span class="icon icon-104"></span> </a>'+
                            '<p id="paragraph" class="paragraph">' +
                            data.desc +
                            '</p>' +
                            '<div class="thumbnails">'
                            for(var j = 0 ; j < data.imgs.length ; ++j) {
                                result += '<div class="roo weui-updown">' +
                                        '<img class="img-max lazyload" src="'+data.imgs[j]+'" style="-webkit-animation: fadeIn 01s ease 0.2s 1 both;animation: fadeIn 1s ease 0.2s 1 both;">' +
                                        '</div>';
                            }

                            result +=
                                    '</div>' +
                                    '<div class="toolbar">' +
                                    '<p class="timestamp"><span>'+data.date+'</span></p>' +
                                    '<div>' +
                                    '<div id="actionMenu" class="actionMenu slideIn">' +
                                    '<p class="actionBtn" id="btnLike"><i class="icon icon-96"></i></p>' +
                                    '<p class="actionBtn" id="btnComment"><i class="icon icon-3"></i></p>' +
                                    '</div>' +
                                    '</div>' +
                                    '<span id="actionToggle" class="actionToggle">..</span>' +
                                    '</div>' +
                                    '<div class="liketext">';
                            for(var j = 0 ; j < data.comment.length; ++j) {
                                var obj = data.comment[j];
                                console.log(obj);
                                if(obj['id']){
                                    result+='<ul class="weui-comment"><li class="weui-comment-item" id="'+obj.id+'">'+
                                            '<div class="userinfo"> <strong class="nickname">'+obj.nickname+'</strong>:</div>'+
                                            '<div class="weui-comment-msg"> <span class="stat"> '+obj.content+' </span>';
                                    if(typeof obj.c !="undefined"){
                                        for(var x=0;x<obj.c.length;x++){
                                            result+='<div class="replay" style="margin-top: 6px" id="'+obj.c[x].id+'">'+
                                                    '<span class="nickname" style="font-size: 15px">'+obj.c[x].nickname+'</span>&nbsp; 回复:'+obj.c[x].rele+':'+
                                                    '<span class="weui-comment-msg">'+obj.c[x].content+'</span></div>';
                                        }
//                                                   result+= '<div class="replay" style="margin-top: 6px">'+
//                                                    '<span class="nickname" style="font-size: 15px">管理员&nbsp;:</span>'+
//                                                    '<span class="weui-comment-msg">哈哈哈</span></div><div class="replay"><span class="nickname" style="font-size: 15px">梁小五&nbsp;: </span>'+
//                                                    '<span class="weui-comment-msg">你怎么看？</span>';
//                                                     $result+='</div> ';
                                    }
                                    result+='</div></li> </ul>';
                                }
                            }
                            result += '</div>' +
                                    '<div class="weui_cells weui_cells_form" style="display: none;">' +
                                    '<div class="weui_cell weui_vcode" gid="'+data.id+'">' +
                                    '<div class="weui_cell_bd weui_cell_primary">' +
                                    '<input class="weui_input" type="text" placeholder="评论" pid="0">' +
                                    '</div>' +
                                    '<div class="weui_cell_ft">' +
                                    '<a href="javascript:;" class="weui-vcode-btn bg-orange fasong">发送</a>' +
                                    '</div>' +
                                    '</div>' +
                                    '</div>' +
                                    '</div>' +
                                    '</div>';
                        }
                        // 如果没有数据
                    } else {
                        // 锁定
                        me.lock();
                        // 无数据
                        me.noData();
                    }
                    // 为了测试，延迟1秒加载
                    setTimeout(function() {
                        $('.moments').append(result);
                        var lazyloadImg = new LazyloadImg({
                            el: '.weui-updown [data-img]', //匹配元素
                            top: 50, //元素在顶部伸出长度触发加载机制
                            right: 50, //元素在右边伸出长度触发加载机制
                            bottom: 50, //元素在底部伸出长度触发加载机制
                            left: 50, //元素在左边伸出长度触发加载机制
                            qriginal: false, // true，自动将图片剪切成默认图片的宽高；false显示图片真实宽高
                            load: function(el) {
                                el.style.cssText += '-webkit-animation: fadeIn 01s ease 0.2s 1 both;animation: fadeIn 1s ease 0.2s 1 both;';
                            },
                            error: function(el) {

                            }
                        });
                        //
                        // 每次数据加载完，必须重置
                        me.resetload();
                    }, 1000);
                },
                error: function(xhr, type) {
                    // alert('上啦error!');
                    // 即使加载出错，也得重置
                    // me.resetload();
                }
            });
        }
    };

    $('.neirongbox').dropload(neirongboxConfig);


</script>
<script src="{$_G['addon_url']}/Public/js/zepto.min.js" type="text/javascript" charset="utf-8"></script>

<script type="text/javascript">
    $(function() {
        $('.weui-menu-inner').click(function() {
            var $menu = $(this).find('ul'),
                    height = $menu.find('li').length + 45 + 'px',
                    display = $menu.css('display');
            $('.weui-menu-inner ul').css({
                'top': '0',
                'display': 'none',
            });
            if(display == 'none') {
                $menu.css({
                    'top': height,
                    'display': 'block'
                });
            } else {
                $menu.css({
                    'top': "0",
                    'display': 'none'
                });
            }
        });

        $('body').on('click','.fasong',function(){
            var input = $(this).parents('div.weui_vcode').find('input');
            var content = input.val();
            if(!content){ $.toast("内容不能为空", "forbidden");return false;}
            var pin = $(this).parents('div.weui_cell_bd').find('div.liketext');
            var pid = Number($(this).parents('div.weui_vcode').find('input').attr('pid'));
            var gid = $(this).parents('div.weui_vcode').attr('gid');
            $.ajax({
                url:"{:create_mobile_url("setmessage")}",
                type:"post",
                dataType:"json",
                data:{'content':content,'gid':gid,'pid':pid},
                success:function(data){
                    console.log(data);
                    if (data.status == 1) {
                        $.toast(data.info);
                        setTimeout(function(){
                            if(pid == 0){

                                var p = '<ul class="weui-comment"><li class="weui-comment-item" id="'+data.mess.id+'"><div class="userinfo"> <strong class="nickname">'+data.mess.nickname+'</strong>:</div><div class="weui-comment-msg"> <span class="stat"> '+content+' </span></div></li> </ul>';
                                $(p).appendTo(pin);
                            }else{
                                var p ='<div class="replay" style="margin-top: 6px" id="'+data.mess.id+'"><span class="nickname" style="font-size: 15px">'+data.mess.nickname+'</span>&nbsp; 回复:'+data.mess.repeNickname+':<span class="weui-comment-msg">'+content+'</span></div>'
                                if($('#'+pid).attr('class') == 'weui-comment-item'){

                                    $(p).appendTo($('#'+pid).find('div.weui-comment-msg'));
                                }else{

                                    $(p).appendTo($('#'+pid).parents('div.weui-comment-msg'));
                                }

                            }
                            input.val("");
                            input.attr('pid',0);
                            input.attr('placeholder','评论');
                        },1500);
                    } else {
                        $.toast(data.info, "forbidden");
                    }
                },
                error:function(){
                    $.toast("错误", "forbidden");
                }
            });
        });
    });


</script>

<script type="text/javascript">
    $(function() {
        var lazyloadImg = new LazyloadImg({
            el: '.weui-updown [data-src]', //匹配元素
            top: 50, //元素在顶部伸出长度触发加载机制
            right: 50, //元素在右边伸出长度触发加载机制
            bottom: 50, //元素在底部伸出长度触发加载机制
            left: 50, //元素在左边伸出长度触发加载机制
            qriginal: false, // true，自动将图片剪切成默认图片的宽高；false显示图片真实宽高
            load: function(el) {
                el.style.cssText += '-webkit-animation: fadeIn 01s ease 0.2s 1 both;animation: fadeIn 1s ease 0.2s 1 both;';
            },
            error: function(el) {

            }
        });
    });
</script>

<!--头部分类信息分类-->
<script type="text/javascript">
    $(function() {
        $('.js-category').click(function(e) {
            $('body').find('.weui-picker-container').remove();
            $parent = $(this).parent('li');
            $('.xila').find('.weui_mask_visible').removeClass('weui_mask_visible');
            var mark ='<div class="weui_mask weui_actions_mask weui_mask_visible"></div>';
            $('.xila').append(mark);
            if($parent.hasClass('js-show')) {
                $parent.removeClass('js-show');
                $('.xila').find('.weui_mask_visible').removeClass('weui_mask_visible');

                $(this).children('i').removeClass('icon-35').addClass('icon-74');
                e.stopPropagation();
            } else {
                $parent.siblings().removeClass('js-show');
                $parent.addClass('js-show');
                $(this).children('i').removeClass('icon-74').addClass('icon-35');
                $parent.siblings().find('i').removeClass('icon-35').addClass('icon-74');
                e.stopPropagation();
            }
        });
        $('.xila').click(function() {
            $nikk = $('.js-category').parent('li');
            $nikk.removeClass('js-show');
            if($nikk.hasClass('js-show')) {
                $('.js-category').children('i').removeClass('icon-35').addClass('icon-74');
            } else {
                $('.js-category').children('i').removeClass('icon-74').addClass('icon-35');
                $nikk.siblings().find('i').removeClass('icon-35').addClass('icon-74');
            }
        });
        $('.xila').on('click',function(){
            $('.js-category').children('i').removeClass('icon-35').addClass('icon-74');
        });
    });
</script>
<!--图片放大-->
<script src="{$_G['addon_url']}/Public/js/swiper.js" type="text/javascript" charset="utf-8"></script>
<script src="{$_G['addon_url']}/Public/js/showimg.js" type="text/javascript" charset="utf-8"></script>
<script src="{$_G['addon_url']}/Public/js/picker.js" type="text/javascript" charset="utf-8"></script>
<!--<script src="{$_G['addon_url']}/Public/js/picker-city.js" type="text/javascript" charset="utf-8"></script>-->
<script>
    + function(a) {
        a.rawCitiesData = [
                <foreach name="goodsTypeList" item="vo" key="k">
        {
            name: "{$k}",
            sub: [
            <foreach name="vo" item="vo2" key="k2">
                {
                    name: "{$vo2.type_name}"
                },
        </foreach>
        ]
    },
        </foreach>
        ]
    }($), + function(a) {
        "use strict";
        var b;
        a.fn.cityPicker = function(c) {
            return c = a.extend({}, b, c), this.each(function() {
                var o, p, q, b = function(a) {
                            var c, d, b = [];
                            for(c = 0; c < a.length; c++) d = a[c], "请选择" !== d.name && b.push(d.name);
                            return b.length ? b : [""]
                        },
                        d = function(a) {
                            return a.sub ? b(a.sub) : [""]
                        },
                        e = function(a) {
                            for(var b = 0; b < g.length; b++)
                                if(g[b].name === a) return d(g[b]);
                            return [""]
                        },
                        f = function(a, b) {
                            var c, e;
                            for(c = 0; c < g.length; c++)
                                if(g[c].name === a)
                                    for(e = 0; e < g[c].sub.length; e++)
                                        if(g[c].sub[e].name === b) return d(g[c].sub[e]);
                            return [""]
                        },
                        g = a.rawCitiesData,
                        h = g.map(function(a) {
                            return a.name
                        }),
                        i = d(g[0]),
                        j = d(g[0].sub[0]),
                        k = h[0],
                        l = i[0],
                        m = j[0],
                        n = [{
                            values: h,
                            cssClass: "col-province"
                        }, {
                            values: i,
                            cssClass: "col-city"
                        }];
                c.showDistrict && n.push({
                    values: j,
                    cssClass: "col-district"
                }), o = {
                    cssClass: "city-picker",
                    rotateEffect: !1,
                    onChange: function(a) {
                        var h, i, j, g = a.cols[0].value;
                        return g !== k ? (i = e(g), h = i[0], j = f(g, h), a.cols[1].replaceValues(i), c.showDistrict && a.cols[2].replaceValues(j), k = g, l = h, a.updateValue(), void 0) : (c.showDistrict && (h = a.cols[1].value, h !== l && (a.cols[2].replaceValues(f(g, h)), l = h, a.updateValue())), void 0)
                    },
                    cols: n
                }, this && (p = a.extend(o, c), q = a(this).val(), q && (p.value = q.split(" "), p.value[0] && (k = p.value[0], p.cols[1].values = e(p.value[0])), p.value[1] ? (l = p.value[1], c.showDistrict && (p.cols[2].values = f(p.value[0], p.value[1]))) : (m = p.value[2], c.showDistrict && (p.cols[2].values = f(p.value[0], p.cols[1].values[0])))), a(this).picker(p))
            })
        }, b = a.fn.cityPicker.prototype.defaults = {
            showDistrict: !0
        }
    }($);
</script>
<script>
    $(function() {

        $("#ss").cityPicker({
            title: "货品分类",
            showDistrict: false
//            onChange: function() {
//                alert(this.value());
//            }
        });

        $('body').on('click',".close-picker",function () {
            // alert($('#ss').val());
            // 获取货品分类
            goods_type = $('#ss').val();
            flushContent();
        })
        $('#ss').on('click', function(e) {
            $('body').children('.weui_mask').remove();
            $('.weui_cell_switch li.js-show').removeClass('js-show');
            $('.js-category').children('i').removeClass('icon-35').addClass('icon-74');
            var html = '<div class="weui_mask weui_actions_mask weui_mask_visible" style="z-index: 50;"></div>';
            $('body').append(html);
//              e.stopPropagation();
        });

    });
</script>

</html>